<!DOCTYPE html>
<html>
	<head>
		<title></title>
		<script src="../../Dependencies/src/?need=M4,Class,Event"></script>
	</head>
	<body>
		<button>Action</button>
		<script>
			function Tester(pElement)
			{
				pElement.addEventListener("click", this._clickHandler.proxy(this), false);
			}

			Class.define(Tester, [Class],
			{
				_clickHandler:function(e)
				{
					var r = new Request("../../NSFW/src/php/proxy.reddit.php");
					r.onComplete(function(e)
					{
						console.log("Completed");
						console.log(e.responseText);
						console.log(e.responseJSON);
					});
					r.onProgress(function(e)
					{
						console.log(e);
						console.log("Progress "+Math.round((e.loaded/ e.total)*100)+"%");
					});
					r.onError(function(e)
					{
						console.log("error");
					});
				}
			});
			new Tester(document.querySelector("button"));
		</script>
	</body>
</html>